#include <iostream>
#include <memory>
#include <vector>
using namespace std;

int main(){
    
    allocator<string> alloc;
    auto const p = alloc.allocate(100); // 预留了存储100个string类型的对象的raw内存空间
    string s;
    string *q = p;
    while(cin >> s && q != p + 100){
        alloc.construct(q++,s); //s是构造的参数
    }
    const size_t size = q - p;
    
    for(size_t i = 0 ; i < size ; i++){
        cout << p[i] << " " << endl;
    }

    while(q!= p){
        alloc.destroy(--q);
    }
    alloc.deallocate(p,100);
    return 0;
}